<HTML>
<HEAD>
<TITLE>[Chapter 19] Cursor </TITLE>
<META NAME="author" CONTENT="John Zukowski">
<META NAME="date" CONTENT="Thu Jul 31 15:11:39 1997">
<META NAME="form" CONTENT="html">
<META NAME="metadata" CONTENT="dublincore.0.1">
<META NAME="objecttype" CONTENT="book part">
<META NAME="otheragent" CONTENT="gmat dbtohtml">
<META NAME="publisher" CONTENT="O'Reilly &amp; Associates, Inc.">
<META NAME="source" CONTENT="SGML">
<META NAME="subject" CONTENT="Java AWT">
<META NAME="title" CONTENT="Java AWT">
<META HTTP-EQUIV="Content-Script-Type" CONTENT="text/javascript">
</HEAD>
<body vlink="#551a8b" alink="#ff0000" text="#000000" bgcolor="#FFFFFF" link="#0000ee">

<DIV CLASS=htmlnav>
<H1><a href='index.htm'><IMG SRC="gifs/smbanner.gif"
     ALT="Java AWT" border=0></a></H1>
<table width=515 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=172 align=left valign=top><A HREF="ch19_16.htm"><IMG SRC="gifs/txtpreva.gif" ALT="Previous" border=0></A></td>
<td width=171 align=center valign=top><B><FONT FACE="ARIEL,HELVETICA,HELV,SANSERIF" SIZE="-1">Chapter 19<br>java.awt Reference</FONT></B></TD>
<td width=172 align=right valign=top><A HREF="ch19_18.htm"><IMG SRC="gifs/txtnexta.gif" ALT="Next" border=0></A></td>
</tr>
</table>

&nbsp;
<hr align=left width=515>
</DIV>
<DIV CLASS=refnamediv>
<H1>Cursor <img src="gifs/bstar.gif" alt="(New)" border=0></H1>

<H2>Name</H2>

Cursor <img src="gifs/bstar.gif" alt="(New)" border=0>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch19-REFSECT1-AUTOID.17"></A></h2>
</DIV>


<p>
<img align=middle src="./figs/cursor.gif" alt="[Graphic: Figure from the text]" width=502 height=53 border=0>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="JAWT-CH-19-REF-CURSOR-SECT-1">Description</A></h2>

<P CLASS=para>
The <tt CLASS=literal>Cursor</tt> class represents 
the mouse pointer. It encapsulates information that used to be in <tt CLASS=literal>java.awt.Frame</tt> 
in the 1.0.2 release. 

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="JAWT-CH-19-REF-CURSOR-SECT-2">Class Definition</A></h2>

<DIV CLASS=screen>
<P>
<PRE>
public class java.awt.Cursor
    extends java.lang.Object
    implements java.io.Serializable {
  // Constants
  public final static int CROSSHAIR_CURSOR;
  public final static int DEFAULT_CURSOR;
  public final static int E_RESIZE_CURSOR;
  public final static int HAND_CURSOR;
  public final static int MOVE_CURSOR;
  public final static int N_RESIZE_CURSOR;
  public final static int NE_RESIZE_CURSOR;
  public final static int NW_RESIZE_CURSOR;
  public final static int S_RESIZE_CURSOR;
  public final static int SE_RESIZE_CURSOR;
  public final static int SW_RESIZE_CURSOR;
  public final static int TEXT_CURSOR;
  public final static int W_RESIZE_CURSOR;
  public final static int WAIT_CURSOR;
  // Class Variables
  protected static Cursor[] predefined;
  // Class Methods
  public static Cursor getDefaultCursor();
  public static Cursor getPredefinedCursor (int type);
  // Constructors
  public Cursor (int type);
  // Instance Methods
  public int getType();
}
</PRE>
</DIV>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="JAWT-CH-19-REF-CURSOR-SECT-3">Constants</A></h2>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-CURSOR-SECT-3.1">CROSSHAIR_CURSOR</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-CURSOR-SECT-3.1.1">public final static int CROSSHAIR_CURSOR</A></h4>

<P CLASS=para>
Constant representing a cursor that looks like a crosshair. 

</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-CURSOR-SECT-3.2">DEFAULT_CURSOR</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-CURSOR-SECT-3.2.1">public final static int DEFAULT_CURSOR</A></h4>

<P CLASS=para>
Constant representing the platform's default cursor. 

</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-CURSOR-SECT-3.3">E_RESIZE_CURSOR</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-CURSOR-SECT-3.3.1">public final static int E_RESIZE_CURSOR</A></h4>

<P CLASS=para>
Constant representing the cursor for resizing an object on the left. 

</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-CURSOR-SECT-3.4">HAND_CURSOR</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-CURSOR-SECT-3.4.1">public final static int HAND_CURSOR</A></h4>

<P CLASS=para>
Constant representing a cursor that looks like a hand. 

</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-CURSOR-SECT-3.5">MOVE_CURSOR</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-CURSOR-SECT-3.5.1">public final static int MOVE_CURSOR</A></h4>

<P CLASS=para>
Constant representing a cursor used to move an object. 

</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-CURSOR-SECT-3.6">N_RESIZE_CURSOR</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-CURSOR-SECT-3.6.1">public final static int N_RESIZE_CURSOR</A></h4>

<P CLASS=para>
Constant representing a cursor for resizing an object on the top. 

</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-CURSOR-SECT-3.7">NE_RESIZE_CURSOR</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-CURSOR-SECT-3.7.1">public final static int NE_RESIZE_CURSOR</A></h4>

<P CLASS=para>
Constant representing a cursor for resizing an object on the top left corner. 

</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-CURSOR-SECT-3.8">NW_RESIZE_CURSOR</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-CURSOR-SECT-3.8.1">public final static int NW_RESIZE_CURSOR</A></h4>

<P CLASS=para>
Constant representing a cursor for resizing an object on the top right 
corner. 

</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-CURSOR-SECT-3.9">S_RESIZE_CURSOR</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-CURSOR-SECT-3.9.1">public final static int S_RESIZE_CURSOR</A></h4>

<P CLASS=para>
Constant representing a cursor for resizing an object on the bottom. 

</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-CURSOR-SECT-3.10">SE_RESIZE_CURSOR</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-CURSOR-SECT-3.10.1">public final static int SE_RESIZE_CURSOR</A></h4>

<P CLASS=para>
Constant representing a cursor for resizing an object on the bottom left 
corner. 

</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-CURSOR-SECT-3.11">SW_RESIZE_CURSOR</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-CURSOR-SECT-3.11.1">public final static int SW_RESIZE_CURSOR</A></h4>

<P CLASS=para>
Constant representing a cursor for resizing an object on the bottom right 
corner. 

</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-CURSOR-SECT-3.12">TEXT_CURSOR</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-CURSOR-SECT-3.12.1">public final static int TEXT_CURSOR</A></h4>

<P CLASS=para>
Constant representing a cursor used within text. 

</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-CURSOR-SECT-3.13">W_RESIZE_CURSOR</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-CURSOR-SECT-3.13.1">public final static int W_RESIZE_CURSOR</A></h4>

<P CLASS=para>
Constant representing a cursor for resizing an object on the right side. 

</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-CURSOR-SECT-3.14">WAIT_CURSOR</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-CURSOR-SECT-3.14.1">public final static int WAIT_CURSOR</A></h4>

<P CLASS=para>
Constant representing a cursor that indicates the program is busy. 

</DIV>

</DIV>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="JAWT-CH-19-REF-CURSOR-SECT-4">Class Variables</A></h2>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-CURSOR-SECT-4.1">predefined</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-CURSOR-SECT-4.1.1">protected static Cursor[] predefined</A></h4>

<P CLASS=para>
An array of cursor instances corresponding to the predefined cursor types. 

</DIV>

</DIV>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="JAWT-CH-19-REF-CURSOR-SECT-5">Class Methods</A></h2>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-CURSOR-SECT-5.1">getDefaultCursor</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-CURSOR-SECT-5.1.1">public static Cursor getDefaultCursor()</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
The default system cursor. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-CURSOR-SECT-5.2">getPredefinedCursor</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-CURSOR-SECT-5.2.1">public static Cursor getPredefinedCursor (int type)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>type</I><br>
<DD>

<P CLASS=para>
One of the type constants defined in this class. </DL>
<p>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
A <tt CLASS=literal>Cursor</tt> object with the specified 
type. </DL>
</DIV>

</DIV>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="JAWT-CH-19-REF-CURSOR-SECT-6">Constructors</A></h2>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-CURSOR-SECT-6.1">Cursor</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-CURSOR-SECT-6.1.1">public Cursor (int type)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>type</I><br>
<DD>

<P CLASS=para>
One of the type constants defined in this class. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Constructs a <tt CLASS=literal>Cursor</tt> object 
with the specified type. </DL>
</DIV>

</DIV>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="JAWT-CH-19-REF-CURSOR-SECT-7">Instance Methods</A></h2>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-CURSOR-SECT-7.1">getType</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-CURSOR-SECT-7.1.1">public int getType()</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
The type of cursor. </DL>
</DIV>

</DIV>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="JAWT-CH-19-REF-CURSOR-SECT-8">See Also</A></h2>

<P CLASS=para>
<tt CLASS=literal>Frame</tt> 

</DIV>


<DIV CLASS=htmlnav>

<P>
<HR align=left width=515>
<table width=515 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=172 align=left valign=top><A HREF="ch19_16.htm"><IMG SRC="gifs/txtpreva.gif" ALT="Previous" border=0></A></td>
<td width=171 align=center valign=top><a href="index.htm"><img src='gifs/txthome.gif' border=0 alt='Home'></a></td>
<td width=172 align=right valign=top><A HREF="ch19_18.htm"><IMG SRC="gifs/txtnexta.gif" ALT="Next" border=0></A></td>
</tr>
<tr>
<td width=172 align=left valign=top>Container</td>
<td width=171 align=center valign=top><a href="index/idx_a.htm"><img src='gifs/index.gif' alt='Book Index' border=0></a></td>
<td width=172 align=right valign=top>Dialog</td>
</tr>
</table>
<hr align=left width=515>

<IMG SRC="gifs/smnavbar.gif" USEMAP="#map" BORDER=0> 
<MAP NAME="map"> 
<AREA SHAPE=RECT COORDS="0,0,108,15" HREF="../javanut/index.htm"
alt="Java in a Nutshell"> 
<AREA SHAPE=RECT COORDS="109,0,200,15" HREF="../langref/index.htm" 
alt="Java Language Reference"> 
<AREA SHAPE=RECT COORDS="203,0,290,15" HREF="../awt/index.htm" 
alt="Java AWT"> 
<AREA SHAPE=RECT COORDS="291,0,419,15" HREF="../fclass/index.htm" 
alt="Java Fundamental Classes"> 
<AREA SHAPE=RECT COORDS="421,0,514,15" HREF="../exp/index.htm" 
alt="Exploring Java"> 
</MAP>
</DIV>

</BODY>
</HTML>
